package com.bw.day_03.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bw.day_03.bean.Tb_brand;
import com.bw.day_03.bean.Tb_goods;
import com.bw.day_03.bean.Tb_goodskind;
import com.bw.day_03.dao.GoodDao;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
@Transactional
public class ServiceImpl implements ServiceL{

	@Autowired
	private GoodDao dao;

	public PageInfo<Tb_goods> list1(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<Tb_goods> list=dao.list1();
		PageInfo<Tb_goods> page = new PageInfo<Tb_goods>(list);
		return page;
	}

	@Override
	public Tb_goods selectxiang(String id) {
		// TODO Auto-generated method stub
		Tb_goods good=dao.selectxiang(id);
		return good;
	}

	@Override
	public List<Tb_brand> list2() {
		// TODO Auto-generated method stub
		List<Tb_brand> list=dao.list2();
		return list;
	}

	@Override
	public List<Tb_goodskind> list3() {
		// TODO Auto-generated method stub
		List<Tb_goodskind> list=dao.list3();
		return list;
	}

	@Override
	public Tb_goods updateselect(String id) {
		// TODO Auto-generated method stub
		Tb_goods good=dao.updateselect(id);
		return good;
	}

	@Override
	public boolean update(Tb_goods good) {
		// TODO Auto-generated method stub
		return dao.update(good);
	}

	@Override
	public boolean add(Tb_goods good) {
		// TODO Auto-generated method stub
		return dao.add(good);
	}

	@Override
	public boolean delete(String id) {
		// TODO Auto-generated method stub
		return dao.delete(id);
	}

	
	
}
